/****************************************************
          File Name:8-1.cpp
          Author: Abby Cin
          Mail: abbytsing@gmail.com
          Created Time: Sat 20 Dec 2014 06:53:56 PM CST
*****************************************************/

#include<iostream>
using namespace std;

void show(const char *str, int n = 0) //default arg
{
    int i = 0;
    if(n != 0)
    {
        while(*str++ != '\0')
            i++;
        cout << "This string has " << i << " charactors" << endl;
    }
    else
        cout << str << endl;
}

int main()
{
    char str[100];
    cout << "Enter a string: ";
    cin.getline(str, 100);
    show(str);
    show(str, 1);

    return 0;
}
